#!/usr/bin/env python
# encoding: utf-8
import yaml
from loguru import logger

""" 
配置信息
"""
def print_config_file():
    logger.info("begin print config.yaml...")
    with open("etc/config.yaml") as f:
        logger.info(f.read())

def load_config():
    config = None
    # print_config_file()
    file_name = "etc/config.yaml"
    # logger.info("load config:{0}".format(file_name))
    with open(file_name) as f:
        config_content = f.read()
        config = yaml.safe_load(config_content)
        # logger.info(config)
        config["kafka"]["conn"]["hosts"] = config["kafka"]["conn"]["hosts"].split(",")
    # logger.info(config)
    return config
